@extends('wap.layouts.master')
@section('title','我的卡卷')

@section('content')

<div class="aw-main aw-user aw-user-card">
	<!--列表-开始-->
	<ul class="aw-card-list">
		<li class="aw-bg-fff aw-card-li" v-for="(list,key) in list_card">
			<div class="aw-card-li-top"></div>
			<div class="aw-card-li-left"><span>@{{Money_type(list.money)}}</span>元</div>
			<div class="aw-card-li-right">
				<div>@{{list.name}}</div>
				<p>有效期至：@{{list.end_time}}</p>
				<p>无门槛，订单支付时选择使用</p>
			</div>
		</li>
	</ul>
	<vue-loding :info_page="info_page"></vue-loding>
	<!--列表-结束-->
</div>

@section('pagejs')
@parent

<script type="text/javascript" src="/wap/js/vue-loding.js"></script>
<script type="text/javascript">
var Get_form={
	page_num:10,
}
var Vue_Data={
	list_card:{},//获取积分列表
	info_page:{count:0,page:1,page_num:Get_form.page_num},
	form:Get_form
}
var AD_list={
	api:'/api/user/user-coupon',
	form_data:Get_form,
	tips:false,
}
function Get_Refresh_Card_List(push){
	getData(AD_list,function(ajax_data){
		if(push==1){
			for(var i=0;i<ajax_data.list.length;i++){
				vm.list_card.push(ajax_data.list[i])
			}
			var info_page={count:ajax_data.count,page:ajax_data.page};
			$.extend(vm.info_page,info_page);
			return;
		}
		Vue_Data.list_card=ajax_data.list;
		var info_page={count:ajax_data.count,page:ajax_data.page};
		$.extend(Vue_Data.info_page,info_page);
		is_watch='';
	})
}
Get_Refresh_Card_List()
vm=new Vue({
	el:'#Vue-body',
	data:Vue_Data,
	components:{
		'vue-loding':V_Assest_loding,
	},methods:{
		Get_List_Data:function(push){
			//更新数据
			$.extend(AD_list.form_data,this.form)
			Get_Refresh_Card_List(push)
		},Money_type:function(money){
			console.log(money)
			var moneys=parseInt(money).toFixed(0)
			return moneys;
		}
	}
})
</script>
@endsection

@endsection

